//
//  CircleMainTableViewCell.swift
//  Gaoloumi
//
//  Created by Jasper on 3/6/16.
//  Copyright © 2016 Jasper. All rights reserved.
//

import UIKit

class PictureMainCell: UITableViewCell {

    @IBOutlet weak var heightLabel: UILabel!
    
    @IBOutlet weak var numberLabel: UILabel!
    
    @IBOutlet weak var cityLabel: UILabel!
    
    @IBOutlet weak var towerNameLabel: UILabel!
    
    @IBOutlet weak var buildTimeLabel: UILabel!
    
    @IBOutlet weak var stausLabel: UILabel!
    
    override func awakeFromNib() {
        super.awakeFromNib()
       cityLabel.adjustsFontSizeToFitWidth = true
    }

    func refreshView(_ tower: Tower, index: Int) {
        numberLabel.text = "\(index)"
        cityLabel.text = "\(tower.allCity!.name!)(\(tower.countryName!))"
        towerNameLabel.text = tower.name
        buildTimeLabel.text = "\(tower.timeFinish)"
        stausLabel.text = tower.status
        heightLabel.text = "\(tower.height)米"
       
        switch tower.status! {
        case "建成":
            stausLabel.textColor = UIColor(red: 77/255, green: 154/255, blue: 212/255, alpha: 1.0)
        case "封顶":
            stausLabel.textColor = UIColor(red: 88/255, green: 190/255, blue: 133/255, alpha: 1.0)
        case "在建":
            stausLabel.textColor = UIColor(red: 234/255, green: 232/255, blue: 77/255, alpha: 1.0)
//        case "预备":
//            stausLabel.textColor = UIColor(red: 41/255, green: 162/255, blue: 239/255, alpha: 1.0)
        case "规划":
            stausLabel.textColor = UIColor(red: 141/255, green: 100/255, blue: 163/255, alpha: 1.0)
        case "搁置":
            stausLabel.textColor = UIColor(red: 235/255, green: 150/255, blue: 69/255, alpha: 1.0)
        default: break
        }
    }
}
